﻿using LayuiMvc.DataEntity.DataEnum;
using LayuiMvc.Util.EnumUtil;
using LayuiMvc.Util.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LayuiMvc.DataModel.Community
{
    public class PostListModel
    {
        /// <summary>
        /// 帖子Id
        /// </summary>
        public int PostId { get; set; }

        /// <summary>
        /// 帖子类型
        /// </summary>
        public PostTypeEnum PostType { get; set; }

        /// <summary>
        /// 帖子类型
        /// </summary>
        public string PostTypeStr
        {
            get { return EnumExtend.GetDescription(PostType); }
        }

        /// <summary>
        /// 标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 帖子内容
        /// </summary>
        public string HtmlContent { get; set; }

        /// <summary>
        /// 回复数量
        /// </summary>
        public int ReplyCount { get; set; }

        /// <summary>
        /// 浏览数量
        /// </summary>
        public int ViewCount { get; set; }

        /// <summary>
        /// 是否置顶
        /// </summary>
        public bool IsTop { get; set; }

        /// <summary>
        /// 是否结帖
        /// </summary>
        public bool IsEnd { get; set; }

        /// <summary>
        /// 是否精华
        /// </summary>
        public bool IsCream { get; set; }

        /// <summary>
        /// 发布者用户Id
        /// </summary>
        public int UserId { get; set; }

        /// <summary>
        /// 发布者昵称
        /// </summary>
        public string NickName { get; set; }

        /// <summary>
        /// 发布者头像地址
        /// </summary>
        public string HeadImgUrl { get; set; }

        /// <summary>
        /// 用户身份标识
        /// </summary>
        public UserIdentityEnum UserIdentity { get; set; }

        public string UserIdentityStr
        {
            get { return EnumExtend.GetDescription(UserIdentity); }
        }

        /// <summary>
        /// 是否认证
        /// </summary>
        public bool IsApprove { get; set; }

        /// <summary>
        /// 认证信息
        /// </summary>
        public string ApproveMsg { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        public DateTime PublishTime { get; set; }

        public string PublishTimeSpan
        {
            get { return TimeSpanHelper.GetTimeSpan(this.PublishTime); }
        }

        /// <summary>
        /// 发布者注册时间
        /// </summary>
        public DateTime RegisterTime { get; set; }
    }
}
